package org.millioncall.yueyoga.admin.dao;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.millioncall.openplatform.common.PaginatedList;
import org.millioncall.yueyoga.admin.dao.entity.ScheduleEntity;
import org.millioncall.yueyoga.admin.model.Chedule;
import org.millioncall.yueyoga.admin.model.ClassScheduleModel;

public interface CheduleDAO {
	public int deleteByPrimaryKey(Integer id);

	public int insert(Chedule record);

	public boolean saveScheduleEntity(ScheduleEntity entity);

	public int insertSelective(Chedule record);

	public Chedule selectByPrimaryKey(Integer id);

	public int updateByPrimaryKeySelective(Chedule record);

	public int updateByPrimaryKey(Chedule record);

	public int updateOrInsert(Chedule record);

	public List<Chedule> findBySubjectId(Integer subjectId);

	public List<ScheduleEntity> findByClassId(Map<String, Object> map);

	public PaginatedList<Chedule> getCheduleInPage(int start, int pageSize,
			Map<String, Object> map);

	public int updateClassChedule(Map<String, Object> map);

	public Chedule getCheduleById(Integer cheduleId);

	public int deleteScheduleByClassIds(List<Integer> classIds);

	/**
	 * 通过班级编号查询班级课程表
	 * 
	 * @param clsId
	 *            班级编号
	 * @param week
	 *            周几
	 * @param date
	 *            时间
	 * @return
	 */
	public List<ClassScheduleModel> findClassSchedulesByClsId(Integer clsId,
			Integer week, String date);

	/**
	 * 查找全部消费课程
	 * 
	 * @param map
	 *            参数集合
	 * @param start
	 *            第几页第一条
	 * @param limit
	 *            每页几条
	 * */
	public PaginatedList<Chedule> findConsumptionSchedule(
			Map<String, Object> map, Integer start, Integer limit);

	/**
	 * 查找新课程
	 * */
	public Chedule findConsumptionNewById(Map<String, Object> map);

	/**
	 * 根据课程周次，班级，课程日期查询课程内容
	 * 
	 * @param map
	 * @return
	 */
	public List<ClassScheduleModel> findScheduleListByCdts(
			Map<String, Object> map);

	/**
	 * 查找符合自动几天开启条件的课程1
	 * 
	 * @param map
	 *            参数集合
	 * */
	public List<Chedule> findAllScheduleOneReserve(Map<String, Object> map);

	/**
	 * 更新自动几天开启预定
	 * 
	 * @param map
	 *            参数集合
	 * */
	public int updateScheduleReserve(Map<String, Object> map);

	/**
	 * 更新课程结束的状态
	 * 
	 * @param map
	 *            参数集合
	 * */
	public int updateScheduleOver(Map<String, Object> map);

	public Set<String> findAllWeekClassIds(int week,Date aDay);

	public Set<String> findAllDateClassIds(Date aDay);
}